import { postRequest, getRequest, putRequest, putRequest2, putRequest3, AddContTypePostRequest } from '@/lib/smart-request';

export const userApi = {
	loginByApp: (param) => {
		return postRequest('/login-api/oauth/third/loginByPassword', param);
	},
	getUserInfo: () => {
		return getRequest('/user/front/users/info', {},false)
	},
	sendCode: (phone) => {
		return getRequest('/user/front/users/code/send?phone=' + phone)
	},
	CheckCode: (param) => {
		return getRequest('/user/front/users/code/check', param)
	},
	SpecificSendCode: (param) => {
		return getRequest('/user/front/users/code/send/specific', param);
	},
	userLogin: (param) => {
		return postRequest('/user/front/users/login', param);
	},
	editUserInfo:(param)=>{
		return putRequest('/user/front/users/edit/user', param);
	},
	relation:(param)=>{
		return postRequest('/user/front/relation/create',param);
	},
	getUser:(param)=>{
		return getRequest('/user/front/users/other/info',param)
	},
	getRelation:(param)=>{
		return getRequest('/user/front/relation/page/to',param)
	},
	getRelationFrom:(param)=>{
		return getRequest('/user/front/relation/page/from',param)
	},
	getFans:(param)=>{
		return getRequest('/user/front/relation/page/to',param)
	},
	refreshUserName: () => {
		return getRequest('/user/front/users/random/name',{},false);
	},
	searchUser:(param)=>{
		return getRequest('/user/front/users/page',param);
	},
	putPosition:(param)=>{
		return putRequest3('/user/front/users/location/report',param)
	},
	clearAll:(parm)=>{
		return putRequest2('/user/front/relation/clear',parm)
	},
	logout:(param)=>{
		return getRequest('/user/front/users/logout',param)
	},
	updatePassword:(param)=>{
		return putRequest('/user/front/users/edit/account/password',param)
	},
	editAccount:(param)=>{
		return putRequest('/user/front/users/edit/account',param)
	},
	realName:(param)=>{
		return putRequest('/user/front/users/name/real/verification',param)
	},
	version:()=>{
		return getRequest('/common/front/common/app/update',{})
	},
	online:()=>{
		return putRequest('/user/front/online/state/online',{})
	},
	offline:()=>{
		return putRequest('/user/front/online/state/offline',{})
	},
	invisible:()=>{
		return putRequest('/user/front/online/state/invisible',{})
	},
	ThirdPartyBindInfo:()=>{
		return putRequest('/user/front/users/list/account/tripartite', false)
	},
	CreateThirdBind:(param)=>{
		return postRequest('/user/front/tripartite/auth/create', param)
	},
	getTokenRefresh:(token)=>{
		return getRequest(`/user/front/users/token/refresh?refreshToken=${token}`,{} )
	}
};